home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 21 / AACD 21.iso / AACD / Utilities / Ghostscript / src / gsfname.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-01-01  |  2.3 KB  |  61 lines

  1. /* Copyright (C) 1993, 1998, 1999 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of AFPL Ghostscript.
  4.   
  5.   AFPL Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author or
  6.   distributor accepts any responsibility for the consequences of using it, or
  7.   for whether it serves any particular purpose or works at all, unless he or
  8.   she says so in writing.  Refer to the Aladdin Free Public License (the
  9.   "License") for full details.
  10.   
  11.   Every copy of AFPL Ghostscript must include a copy of the License, normally
  12.   in a plain ASCII text file named PUBLIC.  The License grants you the right
  13.   to copy, modify and redistribute AFPL Ghostscript, but only under certain
  14.   conditions described in the License.  Among other things, the License
  15.   requires that the copyright notice and this notice be preserved on all
  16.   copies.
  17. */
  18.  
  19. /*$Id: gsfname.h,v 1.2 2000/09/19 19:00:28 lpd Exp $ */
  20.  
  21. #ifndef gsfname_INCLUDED
  22. #  define gsfname_INCLUDED
  23.  
  24. /*
  25.  * Structure and procedures for parsing file names.
  26.  *
  27.  * Define a structure for representing a parsed file name, consisting of
  28.  * an IODevice name in %'s, a file name, or both.  Note that the file name
  29.  * may be either a gs_string (no terminator) or a C string (null terminator).
  30.  *
  31.  * NOTE: You must use parse_[real_]file_name to construct parsed_file_names.
  32.  * Do not simply allocate the structure and fill it in.
  33.  */
  34. #ifndef gx_io_device_DEFINED
  35. #  define gx_io_device_DEFINED
  36. typedef struct gx_io_device_s gx_io_device;
  37. #endif
  38.  
  39. typedef struct gs_parsed_file_name_s {
  40.     gs_memory_t *memory;    /* allocator for terminated name string */
  41.     gx_io_device *iodev;
  42.     const char *fname;
  43.     uint len;
  44. } gs_parsed_file_name_t;
  45.  
  46. /* Parse a file name into device and individual name. */
  47. int gs_parse_file_name(P3(gs_parsed_file_name_t *, const char *, uint));
  48.  
  49. /* Parse a real (non-device) file name and convert to a C string. */
  50. int gs_parse_real_file_name(P5(gs_parsed_file_name_t *, const char *, uint,
  51.                    gs_memory_t *, client_name_t));
  52.  
  53. /* Convert a file name to a C string by adding a null terminator. */
  54. int gs_terminate_file_name(P3(gs_parsed_file_name_t *, gs_memory_t *,
  55.                   client_name_t));
  56.  
  57. /* Free a file name that was copied to a C string. */
  58. void gs_free_file_name(P2(gs_parsed_file_name_t *, client_name_t));
  59.  
  60. #endif /* gsfname_INCLUDED */
  61.